package cn.bluethink.eguan.core.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Id;
import javax.persistence.Table;

import cn.bluethink.eguan.model.core.EgAcount;

/**
 * 账户实体模型
 * 
 * @author 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.2.0
 * @brief 驿馆+（EGUAN）
 * @note 修订历史： 1、wanglei于2018/11/09修订
 */
@Table(name = "eg_acount")
public class EgAcountEntity implements Serializable {

    private static final long serialVersionUID = -3377877658000714388L;

    @Id
    private Long id;

    // 账户名称
    private String oname;

    private Integer bt;

    // 账户更新时间
    private Date utime;

    public EgAcountEntity() {

    }

    public EgAcountEntity(Long id, String oname, Integer bt) {
        this.id = id;
        this.oname = oname;
        this.bt = bt;
        this.utime = new Date();
    }

    public EgAcountEntity(EgAcount acount) {
        this.id = acount.getId();
        this.oname = acount.getName();
        this.bt = acount.getBt();
        this.utime = new Date();
    }

    /**
     * 转业务模型
     * 
     * @return
     */
    public EgAcount createEgAcount() {
        EgAcount acount = new EgAcount(id, oname, bt);
        acount.setUtime(utime);
        return acount;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOname() {
        return oname;
    }

    public void setOname(String oname) {
        this.oname = oname;
    }

    public Integer getBt() {
        return bt;
    }

    public void setBt(Integer bt) {
        this.bt = bt;
    }

    public Date getUtime() {
        return utime;
    }

    public void setUtime(Date utime) {
        this.utime = utime;
    }

}
